<?php
namespace app\admin\model\sum\store;

use app\admin\model\sum\Common;
use app\admin\model\sum\user\User;
use traits\model\SoftDelete;

class Store extends Common
{
    use SoftDelete;
    protected $deleteTime = 'deletetime';

    // 表名
    protected $name = 'sum_store';
    // 追加属性
    protected $append = [
        'status_text',
    ];
    public function user()
    {
        return $this->belongsTo(User::class, 'user_id', 'id')->field('id, nickname, avatar');
    }
    public function agent()
    {
        return $this->belongsTo(User::class, 'agent_id', 'id')->field('id, nickname, avatar');
    }
}
